
# from django.test import TestCase
#
# # Create your tests here.
# import pymysql
#
# mysql_connect=pymysql.connect(host="122.226.199.218",user="salt",port=3309,
#                                    passwd="saltUqeG0xPvz8Iqum7", charset="utf8",db="salt")
#
# cursor=mysql_connect.cursor()
#
# query_string="SELECT `return`,full_ret  from salt_returns where  jid=20170301175245170109"
#
# cursor.execute(query_string)
#
# data=cursor.fetchone()
#
# print(data)

# from bs4 import BeautifulSoup
#
# import urllib.request
# import urllib.parse
# import sys
# import io
# sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')
#
#
# def getHtml(url):
#     opener = urllib.request.build_opener()
#     opener.addheaders = [('User-Agent',
#             'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36'),
#             ]
#
#     urllib.request.install_opener(opener)
#     html_bytes = urllib.request.urlopen(url).read()
#     html_string = html_bytes.decode('GBK')
#     return html_string
#
# html_doc = getHtml("http://www1.fang.com")
# soup = BeautifulSoup(html_doc, 'html.parser')
#
# print(soup.text)
import pymysql
configdict={"host":"122.226.199.218","db":"gm","user":"readonly","passwd":"readonly", "charset":"utf8"}
conn=pymysql.connect(**configdict)
cursor=conn.cursor()
cursor.execute("select * from server_list")
data=cursor.fetchall()
print(data)